package com.shell.governor.modules.controller;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.entity.mvc.RetMsg;
import com.shell.bee.persistence.model.PageLimit;
import com.shell.governor.modules.po.PubMessageTemplate;
import com.shell.governor.modules.service.PubMessageTemplateService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubMessageTemplateController {
	@Autowired
	private PubMessageTemplateService messageTemplateService;

	@RequestMapping
	@Logging(module = "������������", methods = "����������������")
	public List<PubMessageTemplate> selectTemplates(PageLimit limit, PubMessageTemplate messageTemplate) {
		return this.messageTemplateService.selectTemplates(limit, messageTemplate);
	}

	@RequestMapping
	@Logging(module = "������������", methods = "������������")
	public PubMessageTemplate selectTemplate(String id) throws Exception {
		return this.messageTemplateService.selectTemplate(id);
	}

	@RequestMapping
	@Logging(module = "������������", methods = "������������")
	public RetMsg saveTemplate(PubMessageTemplate messageTemplate) {
		return this.messageTemplateService.saveTemplate(messageTemplate);
	}
}
